<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Report/tixianindex')}">提现列表</a></li>
			<if condition="($apply_record['status'] eq 0)">
			<li class="active"><a>提现审核</a></li>
			<else/>	
			<li class="active"><a>提现详情</a></li>
			</if>
		</ul>
        <form class="form-horizontal js-ajax-form" action="{:U('Report/tixian_act')}" method="post">
			<fieldset>
				<div class="tabbable">
					<div class="tab-content">
							<fieldset>
								<input type="hidden" name="options[id]" value="{$id}">
								<div class="control-group">
									<label class="control-label">姓名</label>
									<div class="controls">
										<php>$ds=array('0'=>'<span style="color:red">未认证</span>','1'=>'<span style="color:green">已认证</span>','2'=>'<span style="color:red">认证未通过</span>','3'=>'<span style="color:red">暂时不需要</span>')</php>
										<label class="control-label" style="width:auto">{$list.name}&nbsp&nbsp&nbsp&nbsp{$ds[$list['account_status']]}</label>
										<input type="hidden" name="options[user_id]" value="{$list.id}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">提现金额</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$apply_record.amount}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">手机号码</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$list.mobile}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">银行卡号</label>
									<div class="controls">
									<label class="control-label" style="width:auto">{$list.bank}：{$list.silver_card}&nbsp&nbsp&nbsp&nbsp预留手机号码&nbsp&nbsp{$list.silver_number}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">支付宝账号</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$list.alipay_account}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">充值记录</label>
									<div class="controls">
									<label class="control-label" style="width:auto">
									<if condition="(empty($cong))">
										暂无记录
									<else/>
										<table border="1" style='text-align:center;width:800px' cellpadding='10px'>
											<tr>
												<th>充值时间</th>
												<th>姓名</th>
												<th>充值金额</th>
												<th>身份证号码</th>
											</tr>
											<foreach name="cong" item="vo">
												<tr>
													<td>{$vo.crtime}</td>
													<td>{$vo.name}</td>
													<td>{$vo['amount']/100}元</td>
													<td>{$vo.idno}</td>
												</tr>
											</foreach>
										</table>
									</if>
									</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">分销记录</label>
									<div class="controls">
									<label class="control-label" style="width:auto">
									<if condition="(empty($fen))">
										暂无记录
									<else/>
										<table border="1" style='text-align:center;width:800px' cellpadding='10px'>
											<tr>
												<th>时间</th>
												<th>分销人姓名</th>
												<th>金额</th>
												<th>类型</th>
											</tr>
											<foreach name="fen" item="vo">
												<tr>
													<td>{$vo.crtime}</td>
													<td>{$vo['name']|default=$list['name']}</td>
													<td>{$vo.amount}元</td>
													<td>{$vo['type']==1?'提成记录':'提现记录'}</td>
												</tr>
											</foreach>
										</table>
									</if>
									</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">审核备注</label>
									<div class="controls"><textarea name="options[messgae]" rows="4" cols="30"></textarea></div>
								</div>
							</fieldset>
					</div>
				</div>
				<if condition="($apply_record['status'] eq 0)">
				<div class="form-actions">
					<button class="btn btn-primary js-ajax-submit" type="submit" data-types='1' data-action="{:U('Report/tixian_act',array('display'=>1))}" data-msg='确认提现放款成功?' data-subcheck="true">审核成功</button>
					<button class="btn btn-primary js-ajax-submit" type="submit" data-types='0' data-msg='确认提现放款失败?' data-subtype='true' data-subcheck="true">审核失败</button> * 注:审核失败会退回余额,提现手续费10元
				</div>
				</if>
				
			</fieldset>
		</form>
		
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript">
	var ajaxForm_list = $('form.js-ajax-form');
	if (ajaxForm_list.length) {
	    Wind.use('ajaxForm', 'artDialog', function () {
			
	        $('button.js-ajax-submit').bind('click', function (e) {

	            e.preventDefault();
	            /*var btn = $(this).find('button.js-ajax-submit'),
						form = $(this);*/
	            var btn = $(this),
	                form = btn.parents('form.js-ajax-form');
	
	            //批量操作 判断选项
	            if (btn.data('subcheck')) {
	                btn.parent().find('span').remove();
					var msg = btn.data('msg');
					if (msg) {
						art.dialog({
							id: 'warning',
							icon: 'warning',
							content: btn.data('msg'),
							cancelVal: "{:L('CLOSE')}",
							cancel: function () {
								
							},
							button :[ {
											name : "{:L('OK')}",
											callback:function(){
												ajaxSubmit(btn.data('types'));
											},
											focus : true
									} ]
						});
					} else {
						btn.data('subcheck', false);
						btn.click();
					}
	                return false;
	            }
	        });
	
	    });
	}
	function ajaxSubmit(type){
			var btn = $('button.js-ajax-submit'),
			form = btn.parents('form.js-ajax-form');
			form.ajaxSubmit({
	                url: type ? btn.data('action') : form.attr('action'),
	                //按钮上是否自定义提交地址(多按钮情况)
	                dataType: 'json',
	                beforeSubmit: function (arr, $form, options) {
						var tx=type ? '审核通过' : '审核不通过';
	                    //按钮文案、状态修改
	                    btn.text(tx + '中...').attr('disabled', true).addClass('disabled');
	                },
	                success: function (data, statusText, xhr, $form) {
	                    //按钮文案、状态修改
	                    btn.removeClass('disabled').parent().find('span').remove();
	
	                    if (data.state === 'success') {
	                        $('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function () {
	                            if (data.referer) {
	                                //返回带跳转地址
	                                if (window.parent.art) {
	                                    //iframe弹出页
	                                    window.parent.location.href = data.referer;
	                                } else {
	                                    window.location.href = data.referer;
	                                }
	                            } else {
	                                if (window.parent.art) {
	                                    reloadPage(window.parent);
	                                } else {
	                                    //刷新当前页
	                                    reloadPage(window);
	                                }
	                            }
	                        });
	                    } else if (data.state === 'fail') {
	                        $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
	                        btn.removeProp('disabled').removeClass('disabled');
	                    }
	                }
	            });
	}
	</script>
</body>
</html>